home *** CD-ROM | disk | FTP | other *** search
-
- /* Tools.h: Various #defines and typdefs for GREP
- */
-
- /*
- * #defines for non-printing ASCII characters
- */
- #define NUL 0x00
- #define SOH 0x01
- #define STX 0x02
- #define ETX 0x03
- #define EOT 0x04
- #define ENQ 0x05
- #define ACK 0x06
- #define BEL 0x07
- #define BS 0x08
- #define HT 0x09
- #define LF 0x0a
- #define NL LF
- #define VT 0x0b
- #define FF 0x0c
- #define CR 0x0d
- #define SO 0x0e
- #define SI 0x0f
- #define DLE 0x10
- #define DC1 0x11
- #define DC2 0x12
- #define DC3 0x13
- #define DC4 0x14
- #define NAK 0x15
- #define SYN 0x16
- #define ETB 0x17
- #define CAN 0x18
- #define EM 0x19
- #define SUB 0x1a
- #define DOSEOF SUB
- #define ESC 0x1b
- #define FS 0x1c
- #define GS 0x1d
- #define RS 0x1e
- #define US 0x1f
- #define DEL 0x7f
-
- #define TRUE 1
- #define FALSE 0
-
- /* Definitions of meta-characters used in pattern matching routines
- * LITCHAR & NCCL are only used as tokein identifiers; all the others
- * are also both token identifiers and the actual symbol used in
- * the regural expression.
- */
-
- #define BOL '^'
- #define EOL '$'
- #define ANY '.'
- #define LITCHAR 'L'
- #define ESCAPE '\\'
- #define CCL '['
- #define CCLEND ']'
- #define NEGATE '^'
- #define NCCL '!'
- #define CLOSURE '*'
- #define OR_SYM '|'
-
- #define CLS_SIZE 128 /* Largest permitted size for an expanded
- * character class. (Ie. the class [a-z]
- * will expand into 26 symbols; [a-z0-9] will
- * expand into 36 symbols.)
- */
-
-
- /*
- * Tokens are used to hold pattern templates
- */
-
- typedef struct token{
- char tok;
- char lchar;
- char *string;
- struct token *next;
- }TOKEN;
-
- #define TOKSIZE sizeof(TOKEN)
-
- /*
- * An absolute maximum for strings.
- */
-
- #define MAXSTR 132 /* Maximum number of character in a line
- */
-
- extern char *matchs();
- extern int amatch();
- extern char *in_string();
- extern TOKEN *getpat();
- extern int esc();
- extern int dodash();
- extern TOKEN *makepat();
- extern int unmakepat();
- extern int insert();
- extern int delete();
- extern int isalphanum();
- extern int stoupper();
- extern int pr_tok();
- extern int pr_line();
-